public class method5 {
    public static void main(String[] args) {
        int []arr={1,5,9,8,7,4,2,6,5};
        int max=getmax(arr);
        System.out.println(max);
    }
    public static int getmax(int[]arr) {
        int max=arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (max<arr[i])
            {max=arr[i];}
        }
        return max;
    }
}
